/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.student.tp3assignment2.ocpviolate.Impl;

import com.student.tp3assignment2.ocpviolate.Loanrequestvalidator;
/**
 *
 * @author Student
 */
public class LoanrequestvalidatorImpl implements Loanrequestvalidator{

    double accBalance;

     public void SetBalance(double balance)
     {
         accBalance = balance;
     }

    public String GetApproval()
    {
        if(accBalance > 10000)
            return "Loan Approved";
        else
            return "Insufficient Balance";
    }

// WHAT IF in future, say we want to get approval for a BUSINESS LOAN
// OF a client with at least 100 000, we have to alter this class, add
// another IF Statement thereby violating OCP, as seen in methods below:


// VIOLATION OF OCP

//    public void SetBusinessBalance(double balance)
//    {
//        accBalance = balance;
//    }
//
//    public String GetBusinessApproval()
//    {
//        if(accBalance > 100000)
//            return "Loan Approved";
//        else
//            return "Insufficient Balance";
//    }


}
